package com.yst.metho.web.application.pointage;

import java.util.Calendar;

import nextapp.echo2.app.Column;
import nextapp.echo2.app.Extent;
import nextapp.echo2.app.Grid;
import nextapp.echo2.app.Insets;
import nextapp.echo2.app.Label;
import echopointng.DateChooser;
import echopointng.model.CalendarEvent;
import echopointng.model.CalendarSelectionListener;

/**
 * Vue qui permet de selectionner la semaine pour laquelle l'utilisateur veut
 * generer son rapport hebdomadaire.
 * 
 * @author perso
 * 
 */
public class SelectWeekPane extends Column implements CalendarSelectionListener
{
	private DateChooser mDateField;

	private Calendar mSelectedDay = Calendar.getInstance();

	public SelectWeekPane()
	{
		super();
		setCellSpacing(new Extent(10));
		setInsets(new Insets(10));
		Grid headerGrid = new Grid();
		headerGrid.setInsets(new Insets(0, 2));
		add(headerGrid);
		Label label;

		label = new Label("Semaine : ");
		headerGrid.add(label);
		mDateField = new DateChooser();
		headerGrid.add(mDateField);
		mDateField.getModel().addListener(this);
	}

	public void displayedDateChange(CalendarEvent arg0)
	{
	}

	public void selectedDateChange(CalendarEvent event)
	{
		mSelectedDay = event.getCalendar();
	}

	public Calendar getSelectedDay()
	{
		return mSelectedDay;
	}
}
